Closed-loop anesthesia system